import request from "./index";

// 用户登陆
export const AdminLogin = (data: AdminLoginParams): RpI<LoginRespone> =>
  request.post("/admin/login", data);

// 获取当前登陆用户信息
export const AdminInfo = (): RpI<AdminLoginRes> => request.get("/admin/info");

// 根据用户名或姓名分页获取用户列表
export const AdminList = (params: AdminListParams): RpI<AdminListRespone> =>
  request.get("/admin/list", { params });

// 用户注册
export const AdminRegister = (umsAdminParam: AdminRegisteParam) =>
  request.post("/admin/register", umsAdminParam);

// 根据角色名称分页获取角色列表
export const RoleList = (params: AdminListParams): RpI<RoleListRes> =>
  request.get("/role/list", { params });
